﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using test2_Calculator_wj.CalClasses;

namespace test2_Calculator_wj
{
    public partial class Form1 : Form
    {
        public Form1() 
        {
            InitializeComponent();
            btn0.Click += btn_Click;
            btn1.Click += btn_Click;
            btn2.Click += btn_Click;
            btn3.Click += btn_Click;
            btn4.Click += btn_Click;
            btn5.Click += btn_Click;
            btn6.Click += btn_Click;
            btn7.Click += btn_Click;
            btn8.Click += btn_Click;
            btn9.Click += btn_Click;
            btnPlus.Click += btn_Click;
            btnMinus.Click += btn_Click;
            btnMultiply.Click += btn_Click;
            btnDivide.Click += btn_Click;
        }

        void btn_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;
            textBoxOut.Text += btn.Text;//显示框的字符串的赋值
        }

        private void btnD_Click(object sender, EventArgs e)//等于按钮的操作
        {
            Client client = new Client();
            textBoxOut.Text = client.ClientSelected(textBoxOut.Text);
        }

        private void btnC_Click(object sender, EventArgs e)//删除按钮
        {
            textBoxOut.Text = "";
        }
    }
}
